﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" />
    <title>驰骋流程&表单设计器 </title>
    <base target="_self" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />

    <link href="../../WF/Scripts/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
    <!--<link href="login.css" rel="stylesheet" type="text/css" />-->
    <script src="../../WF/Scripts/QueryString.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/bootstrap/js/jquery.min.js"></script>
    <script src="../../WF/Scripts/config.js" type="text/javascript"></script>
    <script src="../../WF/Comm/Gener.js" type="text/javascript"></script>
    <script src="../../WF/Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="layer/layer.js"></script>
    <script type="text/javascript">
        document.onkeydown = function (e) {
            e = e || window.event;
            if (e.keyCode == 13) {
                Login();
                return false;
            }
        }

        //初始化页面函数.....
        $(function () {

            debugger;
            if (! +[1,]) {
                //  alert("这是ie浏览器，您只能使用sliverlight版本浏览器。");
                // SetHref( '../XAP/Designer.htm';
                // return;
            }

            //$("#Msg").html("<img src='../Img/loading.gif' /><font color=blue>ccbpm 正在为登录/自动升级做准备.</font>");

            //document.getElementById("Btn_Login").disabled = 'disabled';
            //执行更新检查..
            var doType = GetQueryString("DoType");
            var href = GetHrefUrl();
            var urlParam = href.substring(href.indexOf('?') + 1, href.length);
            urlParam = urlParam.replace('&DoType=', '&DoTypeDel=xx');

            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Portal");
            if (doType != null && doType != undefined && doType != "")
                handler.AddPara("LoginType", doType);
            handler.AddUrlData(urlParam);
            data = handler.DoMethodReturnString("Login_Init");

            if (data.indexOf('err@') == 0) {
                alert(data);
                return;
            }
            if (data.indexOf("Install") != -1) {
                var data = data.replace('url@', '');
                SetHref(data);
                return;
            }
            data = JSON.parse(data);

            //调用公共类库的方法:执行批量主表赋值
            GenerFullAllCtrlsVal(data);

            document.title = data.SysName;

            var userNo = $("#TB_No").val();
            if (userNo == "")
                $("#TB_PW").val("");

            $("body").keydown(function () {
                if (event.keyCode == 13) {
                    event.cancelBubble = true;
                    event.returnValue = false;
                    Login();
                }
            });

            handler = new HttpHandler("BP.WF.HttpHandler.WF_Portal");

            var data = handler.DoMethodReturnString("Login_VerifyState");

            if (data.indexOf('err@') == 0) {
                document.getElementById("validate").style.display = "block";
                document.getElementById("verifycode").src = data.split('@')[1];
            }
        });
        function createCode() {
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Portal");

            $("#verifycode").attr('src', handler.DoMethodReturnString("Login_VerifyCode"));
        }
        function LoginText() {
            SetHref( "Default.htm");
        }

        //执行后台登录.
        function Login() {
            //$("#Msg").html("<font> ccbpm 正在登录流程&表单引擎设计器,请稍候... </font>");
            var loading = layer.load(1, { shade: [0.1, '#fff'] });
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Portal");
            layer.close(loading);
            var userNo = $("#TB_No").val();
            var pass = $("#TB_PW").val();

            if (userNo == "" || pass == "") {
                layer.msg("<font>请输入用户名，密码.</font>");
                return;
            }
            //判断验证码是否正确.
            var node = $("#validate");
            if (node.is(':visible') && $("#inputCode").val() == '') {
                alert("请输入验证码");
                return;
            }

            handler.AddPara("VerifyCode", $("#inputCode").val());
            handler.AddPara("TB_No", userNo);
            handler.AddPara("TB_PW", pass);

            var data = handler.DoMethodReturnString("Login_Submit");

            if (data.indexOf('err@') == 0) {
                layer.msg("<font color=red>" + data + "</font>");
                $("#validate").show();
                $("#verifycode").attr('src', handler.DoMethodReturnString("Login_VerifyCode"));
                return;
            }

            if (data.indexOf("Install") != -1) {
                var data = data.replace('url@', '');
                SetHref(data);
                return;
            }
            if (data.indexOf('url@') == 0) {
                var data = data.replace('url@', '');
                SetHref(data);
                return;
            }

            layer.close(index);
            alert(data);
        }


        //设置cookies值
        function setCookie(cname, cvalue, exdays) {
            //var d = new Date();
            //d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
            //var expires = "expires=" + d.toGMTString();
            //document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
        }
        //获取cookies值
        function getCookie(cname) {
            //var name = cname + "=";
            //var decodedCookie = decodeURIComponent(document.cookie);
            //var ca = decodedCookie.split(';');
            //for (var i = 0; i < ca.length; i++) {
            //    var c = ca[i];
            //    while (c.charAt(0) == ' ') {
            //        c = c.substring(1);
            //    }
            //    if (c.indexOf(name) == 0) {
            //        return c.substring(name.length, c.length);
            //    }
            //}
            return "";
        }
        //检查cookies值
        function checkCookie() {
            //var user = getCookie("username");
            //if (user != "") {
            //    $(" select option[value='" + user + "']").attr("selected", "selected");
            //} else {

            //    if (user != "" && user != null) {
            //        setCookie("username", user, 30);
            //    }
            //}
        }
        //手机扫描登录.
        function Mobile() {

            //alert("手机端代码不开放..");
            var url = "LoginGenerQRCodeMobile.htm";
            var handler = new HttpHandler("BP.WF.HttpHandler.WF_Portal");
            var data = handler.DoMethodReturnString("LoginGenerQRCodeMobile_Init");
            if (data.indexOf("err@") == true) {
                //系统错误.
                alert(data);
                return;
            }
            WinOpen(data, "");
        }
    </script>
</head>

<body onload="checkCookie()">
    <div class="container-fluid">
        <div class="login-container">
            <section class="login-sidebox">
                <div class="login-sidebox-content">
                    <div class="login-sidebox-header">
                        <div class="login-sidebox-logo">
                            <img alt="logo" src="image/logo.png" /><span>流程引擎技术</span>
                        </div>
                        <h2 class="login-sidebox-subtitle">
                            驰骋低代码开发平台<br /> CCFast 2.0
                        </h2>
                    </div>
                    <div class="login-sidebox-body">
                        <ul>
                            <li>流程引擎技术</li>
                            <li>表单引擎技术</li>
                            <li>场景应用规则</li>
                            <li>组织结构</li>
                        </ul>
                    </div>
                    <div class="login-sidebox-footer">
                        <div>
                            <a href="http://ccflow.org/frm=Localhost">官网</a> - <a href="http://doc.ccbpm.cn">文档</a> - <a href="http://ccflow.org/ke.htm">视频教程</a>
                        </div>
                    </div>
                </div>
            </section>
            <section class="login-form">
                <div class="login-form-header">
                    <h2>驰骋软件</h2>
                </div>
                <div class="login-form-body">
                    <form id="cc" class="form-signin">

                        <div class="login-wrap">
                            <div class="form-group">

                                <select class="form-control" id="DDL_System" >
                                    <option value="Default" > 驰骋流程应用快速开发平台 - 专业版 </option>
                                    <!--<option value="Business" disabled="disabled" onclick="setCookie('username', $(this).val(), 30)"> 驰骋流程应用快速开发平台 - 商业版 </option>-->
                                </select>
                            </div>

                            <div class="form-group">

                                <input type="text" id="TB_No" name="TB_No" value="admin" placeholder="默认账号:admin" lay-verify="required" class="form-control" />
                            </div>
                            <div class="form-group">

                                <input type="password" id="TB_PW" name="TB_PW" placeholder="默认密码:123" lay-verify="required" class="form-control" />
                            </div>

                            <div id="validate" class="form-group" style="display: none">
                                <input type="text" class="form-control" placeholder="验证码" id="inputCode" style="width:50%;display: inline" />
                                <img id="verifycode" src="" />
                                <a href="javascript:void(0)" style="margin-left: 10px" onclick="createCode()">看不清</a>
                            </div>

                            <input type="button" class="btn btn-lg btn-login btn-block" value="用户登录" id="Btn_Login" onclick="Login();" />

                            <!--<input type="button" class="btn btn-primary btn-block" value="测试版本test" id="Btn_LoginExt" onclick="LoginText();" />-->
                            <!--//  <input type="button" class="btn btn-primary btn-block" value="登录简洁版(开发中)" id="Btn_LoginSimple" onclick="LoginSimple();" />
                            // <input type="button" class="btn btn-primary btn-block" value="登录表单引擎(开发中)" id="Btn_LoginFrm" onclick="LoginFrm();" />-->
                            <!--<div class="text-center">
                                <div class="forget-password">
                                    <a href="javascript:Mobile();">手机登录</a>-->
                            <!--<a href="../AppClassic/Login.htm">前台登录</a>-->
                            <!--</div>
                            </div>-->
                        </div>
                        <div>
                            <div class="login-other">
                                <span class="text-muted">
                                    其他方式登录
                                </span>
                            </div>
                            <div class="login-list">
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="使用 Gitee 帐号登录">
                                        <img class="item" src="image/gitee.svg" />
                                    </a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="使用 GitHub 帐号登录">
                                        <img class="item" src="image/git.svg" />
                                    </a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="微信">
                                        <img class="item" src="image/weixin-2.svg" />
                                    </a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="使用 QQ 账号登录">
                                        <img class="item" src="image/qq.svg" />
                                    </a>
                                </div>
                                <div class="item">
                                    <a href="#" data-toggle="tooltip" title="使用支付宝账号登录">
                                        <img class="item" src="image/zhifubao.svg" />
                                    </a>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </section>
        </div>
        <div class="login-footer">
            <ul class="login-footer-body">
                <li>
                    <a href="http://ccflow.org?Frm=Localhot" target="_blank">
                        济南驰骋信息技术有限公司, 053182374939
                        <br />
                        济南市.高新区.碧桂园凤凰国际F19
                    </a>
                </li>
            </ul>
        </div>
    </div>

    <style type="text/css">
        html {
            font-size: 16px;
            -ms-overflow-style: auto;
        }

        .btn:focus,
        .btn:active:focus,
        .btn.active:focus,
        .btn.focus,
        .btn:active.focus,
        .btn.active.focus {
            outline: none;
            box-shadow: none;
        }

        body {
            color: #797979;
            background: #f1f2f7;
            -webkit-overflow-scrolling: touch;
            font-family: 'Microsoft YaHei';
        }

        a {
            color: #007bff;
            text-decoration: none;
        }

            a:hover {
                color: #17a2b8;
                text-decoration: none;
            }


        .container-fluid {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 1000px;
        }

        .login-container {
            min-height: 500px;
            box-shadow: 0px 20px 80px 0px rgba(0,0,0,0.3);
            display: flex;
            width: 1000px;
        }

            .login-container section {
                width: 50%;
            }

            .login-container .login-sidebox {
                position: relative;
                background: -webkit-gradient(linear, left bottom, left top, from(#3a485a), to(#607089));
                background: linear-gradient(0deg, #3a485a 0%, #607089 100%);
                color: #fff;
            }

                .login-container .login-sidebox::before, .login-container .login-sidebox::after {
                    content: '';
                    top: 0;
                    right: 0;
                    bottom: 0;
                    left: 0;
                    position: absolute;
                }

                .login-container .login-sidebox::before {
                    background: url(image/left-1.png) no-repeat 0 0;
                }

                .login-container .login-sidebox::after {
                    background: url(image/left-2.png) no-repeat right bottom;
                }

                .login-container .login-sidebox .login-sidebox-content {
                    padding: 80px 80px 48px;
                    position: relative;
                    z-index: 1;
                }

        .login-sidebox-header {
            margin-bottom: 40px;
        }

        .login-sidebox-logo {
            display: flex;
            align-items: center;
            margin-bottom: 14px;
        }

            .login-sidebox-logo img {
                width: 48px;
                height: auto;
                border-radius: 50%;
                margin-right: 14px;
            }

            .login-sidebox-logo span {
                display: inline;
                font-size: 1.5rem;
                font-weight: 700;
            }

        .login-sidebox-subtitle {
            font-size: 20pt;
            font-weight: normal;
        }

        .login-sidebox-footer {
            margin-top: 40px;
            border-top: solid 1px #ddd;
            padding-top: 28px;
            font-size: 0.875rem;
            font-weight: 500;
        }

            .login-sidebox-footer a {
                cursor: pointer;
                color: #fff;
            }

        .login-form {
            padding: 64px;
            font-size: 0.875rem;
        }

        .login-form-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            margin-bottom: 20px;
        }

            .login-form-header h2 {
                margin-bottom: 0;
                font-size: 1.714rem;
            }

        .login-other {
            display: table;
            text-align: center;
            white-space: nowrap;
            margin: 0.25rem 0 0.625rem 0;
        }

        .login-other {
            display: table;
            text-align: center;
            white-space: nowrap;
            margin: 0.25rem 0 0.625rem 0;
        }

            .login-other:before, .login-other:after {
                background-image: url("");
                content: '';
                display: table-cell;
                position: relative;
                top: 50%;
                width: 50%;
                background-repeat: no-repeat;
            }

            .login-other:before {
                background-position: right 1em top 50%;
            }

            .login-other:after {
                background-position: left 1em top 50%;
            }

        .login-list {
            display: flex;
            justify-content: space-between;
        }

            .login-list .item {
                width: 32px;
                height: 32px;
            }

        .login-wrap .form-control {
            font-weight: bold;
            padding: 8px 10px;
            height: auto;
            line-height: 24px;
        }

        .btn-login {
            color: #fff;
            background: #fe7300;
            border: 0px;
        }

            .btn-login:hover {
                background: #f38d30;
                color: #fff;
                outline: none
            }

            .btn-login:focus {
                background: #f38d30;
                color: #fff;
                border: 0px;
                outline: none;
            }

        .forget-password {
            padding: 16px 0;
        }

        @media (min-width: 768px) {
            .login-footer {
                display: block;
                position: absolute;
                bottom: 40px;
            }

                .login-footer .login-footer-body {
                    display: flex;
                    width: 600px;
                    justify-content: space-around;
                }

                    .login-footer .login-footer-body li {
                        list-style: none;
                    }

                        .login-footer .login-footer-body li a {
                            color: #7e8392;
                        }
        }
    </style>

</body>
</html>
